package com.xsp.mybatisxmlsqlparser.replacer;

public class CustomPronouns {
    public static String replace(String sql) {
        return sql.replaceAll("#\\{[^}]*}", " ? ");
    }

    public static String whereTagPlaceholder() {
        return " WHERE 1 = 1 ";
    }

    public static String whereEndTagPlaceholder() {
        return " AND @WHERE_END";
    }

    public static String ifStartTagPlaceholder(int index) {
        return " AND @IF_START" + index + " ";
    }

    public static String ifEndTagPlaceholder(int index) {
        return " AND @IF_END" + index + " ";
    }

    public static String forEachPlaceholder(int index) {
        return " _FOREACH" + index + "_";
    }

    public static String chooseStartTagPlaceholder(int index) {
        return " AND @CHOOSE_START" + index + " ";
    }

    public static String chooseEndTagPlaceholder(int index) {
        return " AND @CHOOSE_END" + index + " ";
    }

    public static String whenStartTagPlaceholder(int index) {
        return " AND @WHEN_START" + index + " ";
    }

    public static String whenEndTagPlaceholder(int index) {
        return " AND @WHEN_END" + index + " ";
    }

    public static String otherwiseStartTagPlaceholder(int index) {
        return " AND @OTHERWISE_START" + index + " ";
    }

    public static String otherwiseEndTagPlaceholder(int index) {
        return " AND @OTHERWISE_END" + index + " ";
    }
}
